<script>
$(document).ready(function(){
 function renew11(){
    $("#reload").load("/bootstrap/CDN_moni/totle.php #toltereload");
 }
 setInterval(renew11,120000);
})
</script>

<style type="text/css">
th {
  text-align: center;
}
.panel-body {
  padding:0;
}
</style>
<div id='reload'>
<div id='toltereload' class="row">
<div class="col-md-3">  
<div class="panel panel-default" >
<div class="panel-heading">
<h5 id="errodomain"  style="text-align: center;">&nbsp&nbsp出网域名<small>&nbsp<a onclick="changePage('CDN_moni/mon_domain.php')"><span class="glyphicon glyphicon-info-sign"></span>详细</a></small></h5>
</div>
 <div class="panel-body" style="">
<?php
header("Content-type: text/html; charset=utf-8");
$con_domain = mysql_connect("113.215.1.161","root","root");
if (!$con_domain)
  {
  die('Could not connect: ' . mysql_error());
  }
//code
mysql_select_db("mydb", $con_domain);//选库
mysql_query("set names 'utf8'");
$result = mysql_query("SELECT * FROM CDN_domainTab WHERE flag=1 and mon='yes' group by  Cname");
echo "<table id='store1' class='table-bordered  table-responsive' style='width:100%; text-align:center'>
<tr>
<th>CP</th>
<th>域名</th>
</tr>";
while($row_domain = mysql_fetch_array($result))
  {
  echo "<tr style='color:red;font-weight:bold'>";
  echo "<td>" . $row_domain ['CDN'] . "</td>";
  echo "<td>" . $row_domain ['Cname'] . "</td>";
  echo "</tr>";
  }
echo "</table>";

mysql_close($con_domain);
?> 
</div>
</div>
</div>


<div class="col-md-3"> 
<div class="panel panel-default">
<div class="panel-heading">

<h5 style="text-align: center;">&nbsp&nbsp腾讯OC-端口丢包<small>&nbsp<a onclick="changePage('CDN_moni/tcpingTable.php')"><span class="glyphicon glyphicon-info-sign"></span>详细</a></small></h5>
</div>
<div class="panel-body">
<?php
header("Content-type: text/html; charset=utf-8");
$con_tenoc = mysql_connect("113.215.1.161","root","root");
if (!$con_tenoc)
  {
  die('Could not connect: ' . mysql_error());
  }
//code
mysql_select_db("mydb", $con_tenoc);//选库
mysql_query("set names 'utf8'");
$result = mysql_query("SELECT * FROM ten_oc WHERE mon='yes'  ORDER BY lossRate DESC ");
echo "<table id='store' class='table-bordered   table-responsive' style='width:100%; text-align:center'>
<tr>
<th>丢包主机</th>
<th>丢包率</th>
</tr>";
while($row_tenoc = mysql_fetch_array($result))
  {
  if((float)$row_tenoc['lossRate']>=1){
  echo "<tr style='color:red;font-weight:bold'>";
  echo "<td>" . $row_tenoc ['host'] . "</td>";
  printf("<td>%.2f%%</td>",$row_tenoc['lossRate']);
  echo "</tr>";
}
  }
echo "</table>";

mysql_close($con_tenoc);
?> 
</div>
</div>
</div>
</body>

<div class="col-md-3">
<div class="panel panel-default">
<div class="panel-heading">
<h5 style="text-align: center;">&nbsp&nbsp微信-关键内容丢包<small>&nbsp<a onclick="changePage('CDN_moni/wechat.php')"><span class="glyphicon glyphicon-info-sign"></span>详细</a></small></h5>
</div>
<div class="panel-body">
<?php
header("Content-type: text/html; charset=utf-8");
$con_wechat = mysql_connect("113.215.1.161","root","root");
if (!$con_wechat)
  {
  die('Could not connect: ' . mysql_error());
  }
//code
mysql_select_db("mydb", $con_wechat);//选库
mysql_query("set names 'utf8'");
$result = mysql_query("SELECT * FROM wechat ORDER BY lossRate DESC ");
echo "<table id='store' class='table-bordered   table-responsive' style='width:100%; text-align:center'>
<tr>
<th>内容</th>
<th>ip</th>
<th>丢包率</th>
</tr>";
while($row_wechat = mysql_fetch_array($result))
  {
  if((float)$row_wechat['lossRate']>0){
  echo "<tr style='color:red;font-weight:bold'>";
  echo "<td>" . $row_wechat ['obj'] . "</td>";
  echo "<td>" . $row_wechat ['ip'] . "</td>";
  printf("<td>%.2f%%</td>",$row_wechat['lossRate']);
  echo "</tr>";
}
  }
echo "</table>";

mysql_close($con_wechat);
?> 
</div>
</div>
</div>
<div class="col-md-3">
<div class="panel panel-default">
<div class="panel-heading">
<h5 style="text-align: center;">&nbsp&nbsp政府网站打开异常<small>&nbsp<a onclick="changePage('CDN_moni/gov.php')"><span class="glyphicon glyphicon-info-sign"></span>详细</a></small></h5>
</div>
<div class="panel-body">
<?php
header("Content-type: text/html; charset=utf-8");
$con = mysql_connect("113.215.1.161","root","root");
if (!$con)
  {
  die('Could not connect: ' . mysql_error()); 
  }
//code
mysql_select_db("mydb", $con);//选库
mysql_query("set names 'utf8'");
$result = mysql_query("SELECT * FROM govTab WHERE stat='网站打开异常' AND mon='yes'");
echo "<table  class='table-bordered  table-responsive'  style='width:100%; text-align:center'>
<tr>
<th>gov</th>
<th>网站</th>
</tr>";
while($row = mysql_fetch_array($result))
  {
    echo "<tr style='color:red;font-weight:bold'>";
    echo "<td>" . $row['gov'] . "</td>";
    echo "<td>" . $row['host'] . "</td>";
    echo "</tr>";
}
echo "</table>";
mysql_close($con);
?> 
</div>
</div>
</div>
</div>
</div>